<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
       fetch("sayhi").then(function (res) {
            return res.text().then(function (text) {
                document.getElementById("d").innerText=text;
            })

        });
    </script>
</head>
<body>
<h1>你好</h1>
<div id="d">


</div>

</body>
</html>